﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;

namespace PFAGame
{
    class MeleeBoss : AMob
    {

        public MeleeBoss(float x, float y)
        {
            position.X = x;
            position.Y = y;
            type = e_typeMob.MELEEBOSS;

            moveRightAnim.Initialize(ScreenManager.Singleton.Game.Content.Load<Texture2D>("Images/Mob/MobCAC/MobCACRunSide"), 503, 504, 2, (int)(100 / speed), true);
            moveLeftAnim.Initialize(ScreenManager.Singleton.Game.Content.Load<Texture2D>("Images/Mob/MobCAC/MobCACRunSide2"), 503, 504, 2, (int)(100 / speed), true);
            moveUpAnim.Initialize(ScreenManager.Singleton.Game.Content.Load<Texture2D>("Images/Mob/MobCAC/MobCACRunFront"), 503, 504, 2, (int)(100 / speed), true);
            moveDownAnim.Initialize(ScreenManager.Singleton.Game.Content.Load<Texture2D>("Images/Mob/MobCAC/MobCACRunBack"), 503, 504, 2, (int)(100 / speed), true);

            attackRightAnim.Initialize(ScreenManager.Singleton.Game.Content.Load<Texture2D>("Images/Mob/MobCAC/MobCACHitSide"), 503, 504, 3, (int)(30 * speed), false);
            attackLeftAnim.Initialize(ScreenManager.Singleton.Game.Content.Load<Texture2D>("Images/Mob/MobCAC/MobCACHitSide2"), 503, 504, 3, (int)(30 * speed), false);
            attackUpAnim.Initialize(ScreenManager.Singleton.Game.Content.Load<Texture2D>("Images/Mob/MobCAC/MobCACHitFront"), 503, 504, 3, (int)(30 * speed), false);
            attackDownAnim.Initialize(ScreenManager.Singleton.Game.Content.Load<Texture2D>("Images/Mob/MobCAC/MobCACHitBack"), 503, 504, 3, (int)(30 * speed), false);

            color = Color.Blue;
            scale = 2.0f;
            radius = 0.8f;
        }

        protected override void attack()
        {
            //inflige les dégats, si la cibles est toujours à porté
            if (target.getSquaredDistance(position) <= range * range)
                target.receiveDammage(dammage);

            MeleeRobot.soundInstance[MeleeRobot.n++].Play();
            if (MeleeRobot.n >= MeleeRobot.COUNT_INSTANCE)
                MeleeRobot.n = 0;
        }

        public override void init()
        {
            base.init();
            life = 300;
            exp = 40;
            speed = 2.6f;
        }
    }
}
